import Vue from 'vue'
import Router from 'vue-router'
const index = r => require.ensure([], () => r(require('../pages/index')), 'index')
const promise = r => require.ensure([], () => r(require('../pages/promise')), 'promise')

Vue.use(Router)

const router = new Router({
  routes: [
    { // 首页
      path: '/',
      name: 'index',
      meta: {title: '首页'},
      component: index
    },
    { // promise
      path: '/promise',
      name: 'promise',
      meta: {title: 'promise'},
      component: promise
    }
  ]
})

export default router
